package com.my.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.FullHttpRequest;

/**
 * @author WangLuoXin
 * &#064;Date 2024/9/19  11:00
 * 日志记录处理器  TODO 暂未实现
 **/
public class LoggerHandler extends SimpleChannelInboundHandler<FullHttpRequest> {


    @Override
    protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest fullHttpRequest) throws Exception {
        String uri = fullHttpRequest.uri();
        if (uri.contains("favicon.ico")) {
            return;
        }

        //TODO 日志业务处理
        System.out.println("logger client received: " + fullHttpRequest.uri());
        ctx.fireChannelRead(fullHttpRequest.retain());
    }
}
